$(info start)
arch ?= x86
ifeq ($(arch),arm)
    kernel_dir := /home/linux/linux5.10.61
else
    kernel_dir := /lib/modules/$(shell uname -r)/build
endif

$(info kernel_dir $(kernel_dir))

pwd = $(shell pwd)
# KBUILD_EXTRA_SYMBOLS += /home/linux/TestModules/my_test_module/my_test_moduleB/Module.symvers
all:
	# 必须是Tab分格符，空格会报错
	make -C $(kernel_dir) modules M=$(pwd)
clean:
	make -C $(kernel_dir) clean M=$(pwd)
install:
	make -C $(kernel_dir) modules_install M=$(pwd) INSTALL_MOD_PATH=$(pwd) #输出是/lib/modules/$(shell uname -r)/updates，指定目录该目录新建这个输出
obj-m += my_sample_cdev.o